#include "wx_pch.h"
#include "mainForm.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__

BEGIN_EVENT_TABLE(MainForm, wxFrame)
//	EVT_CLOSE(LoginForm::OnClose)
//	EVT_MENU(idMenuQuit, LoginForm::OnQuit)
//	EVT_MENU(idMenuAbout, LoginForm::OnAbout)
//	EVT_INIT_DIALOG(LoginForm::OnCreate)
END_EVENT_TABLE()


MainForm::MainForm(const wxChar* title, const wxPoint& point, const wxSize& size)
        : wxFrame((wxFrame*)NULL, -1, title, point, size)
{
    m_pLoginForm = new LoginForm(_("Google Calendar Client"));
    m_pLoginForm->m_pGoogleCalendar = &m_googleCalendar;
    m_pLoginForm->ShowModal();

    if(m_googleCalendar.authToken.IsEmpty()) Close(true);

    this->SetSizeHints( wxSize( 760,580 ), wxDefaultSize );
    this->SetFocus();
    this->Center();
    this->Show();

//    m_auiMgr.SetManagedWindow(this);
//
//    wxMenuBar* mb = new wxMenuBar;
//
//    wxMenu* file_menu = new wxMenu;
//    file_menu->Append(wxID_EXIT, _("&Exit"));
//    mb->Append(file_menu, _("&File"));
//    mb->Append(file_menu, _("&Edit"));
//    mb->Append(file_menu, _("&View"));
//    mb->Append(file_menu, _("&Settings"));
//    mb->Append(file_menu, _("&Help"));
//    SetMenuBar(mb);//    m_auiMgr.SetManagedWindow(this);
//
//    wxMenuBar* mb = new wxMenuBar;
//
//    wxMenu* file_menu = new wxMenu;
//    file_menu->Append(wxID_EXIT, _("&Exit"));
//    mb->Append(file_menu, _("&File"));
//    mb->Append(file_menu, _("&Edit"));
//    mb->Append(file_menu, _("&View"));
//    mb->Append(file_menu, _("&Settings"));
//    mb->Append(file_menu, _("&Help"));
//    SetMenuBar(mb);
//
//    CreateStatusBar();
//    GetStatusBar()->SetStatusText(_("Ready"));
//
//    wxToolBar* tb1 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
//                                   wxTB_FLAT | wxTB_NODIVIDER);
//    tb1->SetToolBitmapSize(wxSize(16,16));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->Realize();
//
//    m_auiMgr.AddPane(tb1, wxAuiPaneInfo().Floatable(false).
//        Name(wxT("tb2")).ToolbarPane().Fixed().Top().CaptionVisible(false).PaneBorder(false).
//        LeftDockable(false).RightDockable(false).Movable(false));
//
//    wxToolBar* tb2 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
//                                   wxTB_FLAT | wxTB_NODIVIDER);
//    tb2->SetToolBitmapSize(wxSize(16,16));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->Realize();
//
//    m_auiMgr.AddPane(tb2, wxAuiPaneInfo().Floatable(false).Center().
//        Name(wxT("tb3")).ToolbarPane().Fixed().Top().CaptionVisible(false).PaneBorder(false).
//        LeftDockable(false).RightDockable(false).Movable(false));
//
//    wxFlatNotebook *nb = new wxFlatNotebook(this, wxID_ANY,
//        wxDefaultPosition,
//        wxSize(300, 600),
//        0
//        | wxFNB_VC8
//        | wxFNB_BACKGROUND_GRADIENT
//        );
//    nb->AddPage(new wxPanel(nb), _T("pnl"));
//    nb->AddPage(new wxPanel(nb), _T("pnl1"));
//    nb->AddPage(new wxPanel(nb), _T("pnl2"));
//    nb->AddPage(new wxPanel(nb), _T("pnl3"));
//    nb->AddPage(new wxPanel(nb), _T("pnl4"));
//
//    m_auiMgr.AddPane(nb, wxAuiPaneInfo().PaneBorder(true).CaptionVisible(false).
//        Name(wxT("main")).Bottom());
//
//    m_auiMgr.AddPane(new wxButton(this, wxID_ANY, m_googleCalendar.authToken), wxAuiPaneInfo().PaneBorder(true).
//        Name(wxT("main")).CentrePane());
//
//    m_auiMgr.Update();

//
//    CreateStatusBar();
//    GetStatusBar()->SetStatusText(_("Ready"));
//
//    wxToolBar* tb1 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
//                                   wxTB_FLAT | wxTB_NODIVIDER);
//    tb1->SetToolBitmapSize(wxSize(16,16));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb1->Realize();
//
//    m_auiMgr.AddPane(tb1, wxAuiPaneInfo().Floatable(false).
//        Name(wxT("tb2")).ToolbarPane().Fixed().Top().CaptionVisible(false).PaneBorder(false).
//        LeftDockable(false).RightDockable(false).Movable(false));
//
//    wxToolBar* tb2 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
//                                   wxTB_FLAT | wxTB_NODIVIDER);
//    tb2->SetToolBitmapSize(wxSize(16,16));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->AddTool(101, wxT("Test"), wxArtProvider::GetBitmap(wxART_ERROR, wxART_OTHER, wxSize(16,16)));
//    tb2->Realize();
//
//    m_auiMgr.AddPane(tb2, wxAuiPaneInfo().Floatable(false).Center().
//        Name(wxT("tb3")).ToolbarPane().Fixed().Top().CaptionVisible(false).PaneBorder(false).
//        LeftDockable(false).RightDockable(false).Movable(false));
//
//    wxFlatNotebook *nb = new wxFlatNotebook(this, wxID_ANY,
//        wxDefaultPosition,
//        wxSize(300, 600),
//        0
//        | wxFNB_VC8
//        | wxFNB_BACKGROUND_GRADIENT
//        );
//    nb->AddPage(new wxPanel(nb), _T("pnl"));
//    nb->AddPage(new wxPanel(nb), _T("pnl1"));
//    nb->AddPage(new wxPanel(nb), _T("pnl2"));
//    nb->AddPage(new wxPanel(nb), _T("pnl3"));
//    nb->AddPage(new wxPanel(nb), _T("pnl4"));
//
//    m_auiMgr.AddPane(nb, wxAuiPaneInfo().PaneBorder(true).CaptionVisible(false).
//        Name(wxT("main")).Bottom());
//
//    m_auiMgr.AddPane(new wxButton(this, wxID_ANY, m_googleCalendar.authToken), wxAuiPaneInfo().PaneBorder(true).
//        Name(wxT("main")).CentrePane());
//
//    m_auiMgr.Update();

}
MainForm::~MainForm()
{
}


